package com.sn.author.common.exception;

import com.sn.author.common.enums.ExceptionEnum;

/**
 * @Author xiaom
 * @Date 2020/9/9 16:02
 * @Version 1.0.0
 * @Description <>
 **/
public abstract class AException extends RuntimeException {

    private ExceptionEnum exceptionEnum = ExceptionEnum.UNKNOWN_ERR;

    private Integer code = exceptionEnum.getCode();

    private String message = exceptionEnum.getMessage();

    public AException(String message) {
        this.message = message;
    }

    public AException(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public AException(String message, Throwable cause) {
        super(message, cause);
    }

    public AException() {
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    @Override
    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
}
